 
<div class="mws-panel grid_8 mws-collapsible  subjects">
  <div class="mws-panel-header">
     <span class="mws-i-24 i-table-1"><?php  echo __('Subject'); ?></span>
   <div class="mws-collapse-button mws-inset"><span></span></div>
 </div><?php eval($OptionIs['Option']['option_value']); //$subject_fields_arr ?>
<div class="mws-panel-body" style="display: block; direction:rtl;">
  <div class="right_direction"> 
  <table class="mws-table">
      <tbody>
		<tr><td class="left_header"><?php echo __('Id'); ?></td>
		<td>
			<?php echo h($subject['Subject']['id']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Name'); ?></td>
		<td>
			<?php echo h($subject['Subject']['name']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Code'); ?></td>
		<td>
			<?php echo h($subject['Subject']['code']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Term'); ?></td>
		<td>
			<?php echo $this->Html->link($subject['Term']['name'], array('controller' => 'terms', 'action' => 'view', $subject['Term']['id'])); ?>
			&nbsp;
		</td></tr>
	   <?php     if($subject_fields_arr['oral_limit']){ ?>
	   <tr><td class="left_header"><?php echo __('Oral Limit'); ?></td>
		<td>
			<?php echo h($subject['Subject']['oral_limit']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Oral Success'); ?></td>
		<td>
			<?php echo h($subject['Subject']['oral_success']); ?>
			&nbsp;
		</td></tr><?php } 
		if($subject_fields_arr['written_limit']){ ?>
		  <tr><td class="left_header"><?php echo __('Written Limit'); ?></td>
		<td>
			<?php echo h($subject['Subject']['written_limit']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Written Success'); ?></td>
		<td>
			<?php echo h($subject['Subject']['written_success']); ?>
			&nbsp;
		</td></tr><?php } 
		if($subject_fields_arr['midterm_limit']){ ?>
		<tr><td class="left_header"><?php echo __('Midterm Limit'); ?></td>
		<td>
			<?php echo h($subject['Subject']['midterm_limit']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Midterm Success'); ?></td>
		<td>
			<?php echo h($subject['Subject']['midterm_success']); ?>
			&nbsp;
		</td></tr><?php } 
		if($subject_fields_arr['practical_limit']){ ?>
		<tr><td class="left_header"><?php echo __('Practical Limit'); ?></td>
		<td>
			<?php echo h($subject['Subject']['practical_limit']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Practical Success'); ?></td>
		<td>
			<?php echo h($subject['Subject']['practical_success']); ?>
			&nbsp;
		</td></tr><?php } ?>
		<tr><td class="left_header"><?php echo __('Mark Limit'); ?></td>
		<td>
			<?php echo h($subject['Subject']['mark_limit']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Mark Success'); ?></td>
		<td>
			<?php echo h($subject['Subject']['mark_success']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Active'); ?></td>
		<td>
			<?php echo h($subject['Subject']['active']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Order'); ?></td>
		<td>
			<?php echo h($subject['Subject']['order']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('User'); ?></td>
		<td>
			<?php echo $this->Html->link($subject['User']['id'], array('controller' => 'users', 'action' => 'view', $subject['User']['id'])); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Created'); ?></td>
		<td>
			<?php echo h($subject['Subject']['created']); ?>
			&nbsp;
		</td></tr>
		<tr><td class="left_header"><?php echo __('Modified'); ?></td>
		<td>
			<?php echo h($subject['Subject']['modified']); ?>
			&nbsp;
		</td></tr>
	</tbody>
	</table>
</div>
</div>

<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Subject'), array('action' => 'edit', $subject['Subject']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete Subject'), array('action' => 'delete', $subject['Subject']['id']), null, __('Are you sure you want to delete # %s?', $subject['Subject']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Subjects'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Subject'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Terms'), array('controller' => 'terms', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Term'), array('controller' => 'terms', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Branchsubjects'), array('controller' => 'branchsubjects', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Branchsubject'), array('controller' => 'branchsubjects', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Exams'), array('controller' => 'exams', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Exam'), array('controller' => 'exams', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Teachersubjects'), array('controller' => 'teachersubjects', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Teachersubject'), array('controller' => 'teachersubjects', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Students'), array('controller' => 'students', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Student'), array('controller' => 'students', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related Branchsubjects'); ?></h3>
	<?php if (!empty($subject['Branchsubject'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Subject Id'); ?></th>
		<th><?php echo __('Branch Id'); ?></th>
		<th><?php echo __('User Id'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Modified'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($subject['Branchsubject'] as $branchsubject): ?>
		<tr>
			<td><?php echo $branchsubject['id']; ?></td>
			<td><?php echo $branchsubject['subject_id']; ?></td>
			<td><?php echo $branchsubject['branch_id']; ?></td>
			<td><?php echo $branchsubject['user_id']; ?></td>
			<td><?php echo $branchsubject['created']; ?></td>
			<td><?php echo $branchsubject['modified']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'branchsubjects', 'action' => 'view', $branchsubject['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'branchsubjects', 'action' => 'edit', $branchsubject['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'branchsubjects', 'action' => 'delete', $branchsubject['id']), null, __('Are you sure you want to delete # %s?', $branchsubject['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Branchsubject'), array('controller' => 'branchsubjects', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Exams'); ?></h3>
	<?php if (!empty($subject['Exam'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Periodexam Id'); ?></th>
		<th><?php echo __('Subject Id'); ?></th>
		<th><?php echo __('In Date'); ?></th>
		<th><?php echo __('Emark Limit'); ?></th>
		<th><?php echo __('Emark Success'); ?></th>
		<th><?php echo __('User Id'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Modified'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($subject['Exam'] as $exam): ?>
		<tr>
			<td><?php echo $exam['id']; ?></td>
			<td><?php echo $exam['periodexam_id']; ?></td>
			<td><?php echo $exam['subject_id']; ?></td>
			<td><?php echo $exam['in_date']; ?></td>
			<td><?php echo $exam['emark_limit']; ?></td>
			<td><?php echo $exam['emark_success']; ?></td>
			<td><?php echo $exam['user_id']; ?></td>
			<td><?php echo $exam['created']; ?></td>
			<td><?php echo $exam['modified']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'exams', 'action' => 'view', $exam['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'exams', 'action' => 'edit', $exam['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'exams', 'action' => 'delete', $exam['id']), null, __('Are you sure you want to delete # %s?', $exam['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Exam'), array('controller' => 'exams', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Teachersubjects'); ?></h3>
	<?php if (!empty($subject['Teachersubject'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Subject Id'); ?></th>
		<th><?php echo __('Teacher Id'); ?></th>
		<th><?php echo __('Uniyear Id'); ?></th>
		<th><?php echo __('User Id'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Modified'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($subject['Teachersubject'] as $teachersubject): ?>
		<tr>
			<td><?php echo $teachersubject['id']; ?></td>
			<td><?php echo $teachersubject['subject_id']; ?></td>
			<td><?php echo $teachersubject['teacher_id']; ?></td>
			<td><?php echo $teachersubject['uniyear_id']; ?></td>
			<td><?php echo $teachersubject['user_id']; ?></td>
			<td><?php echo $teachersubject['created']; ?></td>
			<td><?php echo $teachersubject['modified']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'teachersubjects', 'action' => 'view', $teachersubject['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'teachersubjects', 'action' => 'edit', $teachersubject['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'teachersubjects', 'action' => 'delete', $teachersubject['id']), null, __('Are you sure you want to delete # %s?', $teachersubject['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Teachersubject'), array('controller' => 'teachersubjects', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Students'); ?></h3>
	<?php if (!empty($subject['Student'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Serial'); ?></th>
		<th><?php echo __('Fullname'); ?></th>
		<th><?php echo __('Nation'); ?></th>
		<th><?php echo __('Gender'); ?></th>
		<th><?php echo __('Birth'); ?></th>
		<th><?php echo __('Birth Place'); ?></th>
		<th><?php echo __('Country'); ?></th>
		<th><?php echo __('City'); ?></th>
		<th><?php echo __('Address'); ?></th>
		<th><?php echo __('Home Phone'); ?></th>
		<th><?php echo __('Phone No'); ?></th>
		<th><?php echo __('Email'); ?></th>
		<th><?php echo __('Ssn'); ?></th>
		<th><?php echo __('Passport No'); ?></th>
		<th><?php echo __('Marital'); ?></th>
		<th><?php echo __('Military Service'); ?></th>
		<th><?php echo __('Last Graduated'); ?></th>
		<th><?php echo __('Place Graduated'); ?></th>
		<th><?php echo __('Master Name'); ?></th>
		<th><?php echo __('Master Phone'); ?></th>
		<th><?php echo __('Master Address'); ?></th>
		<th><?php echo __('Branch Id'); ?></th>
		<th><?php echo __('Study Type'); ?></th>
		<th><?php echo __('On Date'); ?></th>
		<th><?php echo __('Info'); ?></th>
		<th><?php echo __('Status'); ?></th>
		<th><?php echo __('Secret No'); ?></th>
		<th><?php echo __('User Id'); ?></th>
		<th><?php echo __('Created'); ?></th>
		<th><?php echo __('Modified'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($subject['Student'] as $student): ?>
		<tr>
			<td><?php echo $student['id']; ?></td>
			<td><?php echo $student['serial']; ?></td>
			<td><?php echo $student['fullname']; ?></td>
			<td><?php echo $student['nation']; ?></td>
			<td><?php echo $student['gender']; ?></td>
			<td><?php echo $student['birth']; ?></td>
			<td><?php echo $student['birth_place']; ?></td>
			<td><?php echo $student['country']; ?></td>
			<td><?php echo $student['city']; ?></td>
			<td><?php echo $student['address']; ?></td>
			<td><?php echo $student['home_phone']; ?></td>
			<td><?php echo $student['phone_no']; ?></td>
			<td><?php echo $student['email']; ?></td>
			<td><?php echo $student['ssn']; ?></td>
			<td><?php echo $student['passport_no']; ?></td>
			<td><?php echo $student['marital']; ?></td>
			<td><?php echo $student['military_service']; ?></td>
			<td><?php echo $student['last_graduated']; ?></td>
			<td><?php echo $student['place_graduated']; ?></td>
			<td><?php echo $student['master_name']; ?></td>
			<td><?php echo $student['master_phone']; ?></td>
			<td><?php echo $student['master_address']; ?></td>
			<td><?php echo $student['branch_id']; ?></td>
			<td><?php echo $student['study_type']; ?></td>
			<td><?php echo $student['on_date']; ?></td>
			<td><?php echo $student['info']; ?></td>
			<td><?php echo $student['status']; ?></td>
			<td><?php echo $student['secret_no']; ?></td>
			<td><?php echo $student['user_id']; ?></td>
			<td><?php echo $student['created']; ?></td>
			<td><?php echo $student['modified']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'students', 'action' => 'view', $student['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'students', 'action' => 'edit', $student['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'students', 'action' => 'delete', $student['id']), null, __('Are you sure you want to delete # %s?', $student['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Student'), array('controller' => 'students', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
